package com.example.dao;
import com.example.entity.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserDao {
    //User getUserById(@Param("user_id") int user_id);
    // User findByUsername(@Param("username") String username);

    User findByUserNameAndPassword(String username, String password);

    int addUserDao(String username,String password,String email,String phone,int role);
    Integer getUserRole(int user_id);
    List<User> userListDao();

    int deleteUser(@Param("user_id") Integer user_id);

    boolean updateUser(User user);

    User getUserById(Integer userId);

    int insert(User user);
    User getUserById(int userId);
    boolean updateUserProfile(@Param("user_id") Integer userId,
                              @Param("email") String email,
                              @Param("phone") String phone);

}
